package org.kele.servicecomb.provider.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.servicecomb.provider.pojo.RpcSchema;
import org.apache.servicecomb.swagger.invocation.context.HttpStatus;
import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
import org.kele.servicecomb.api.rpc.BmiCalculateForRestRpc;
import org.kele.servicecomb.ex.BizException;

import javax.ws.rs.core.Response;

/**
 * 内部微服务调用 使用rpcschema
 */
@Slf4j
@RpcSchema(schemaId = "BmiController")
public class BmiController implements BmiCalculateForRestRpc {

    @Override
    public double calculate(double height, double weight) {
        log.info("处理请求...{},{}", height, weight);
        return height / weight;
    }

    @Override
    public String testEx() {
        throw new BizException("i am wrong");
    }

}
